Left Termination of the query pattern weight_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

sum(.(s(N), XS), .(M, YS), ZS) :- sum(.(N, XS), .(s(M), YS), ZS).
sum(.(0, XS), YS, ZS) :- sum(XS, YS, ZS).
sum([], YS, YS).
weight(.(N, .(M, XS)), X) :- ','(sum(.(N, .(M, XS)), .(0, XS), YS), weight(YS, X)).
weight(.(X, []), X).

Queries:

weight(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

WEIGHT_IN(.(N, .(M, XS)), X) → U31(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
WEIGHT_IN(.(N, .(M, XS)), X) → SUM_IN(.(N, .(M, XS)), .(0, XS), YS)
SUM_IN(.(0, XS), YS, ZS) → U21(XS, YS, ZS, sum_in(XS, YS, ZS))
SUM_IN(.(0, XS), YS, ZS) → SUM_IN(XS, YS, ZS)
SUM_IN(.(s(N), XS), .(M, YS), ZS) → U11(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
SUM_IN(.(s(N), XS), .(M, YS), ZS) → SUM_IN(.(N, XS), .(s(M), YS), ZS)
U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U41(N, M, XS, X, weight_in(YS, X))
U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN(YS, X)

The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)
WEIGHT_IN(x1, x2)  =  WEIGHT_IN(x1)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U31(x1, x2, x3, x4, x5)  =  U31(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x6)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

WEIGHT_IN(.(N, .(M, XS)), X) → U31(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
WEIGHT_IN(.(N, .(M, XS)), X) → SUM_IN(.(N, .(M, XS)), .(0, XS), YS)
SUM_IN(.(0, XS), YS, ZS) → U21(XS, YS, ZS, sum_in(XS, YS, ZS))
SUM_IN(.(0, XS), YS, ZS) → SUM_IN(XS, YS, ZS)
SUM_IN(.(s(N), XS), .(M, YS), ZS) → U11(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
SUM_IN(.(s(N), XS), .(M, YS), ZS) → SUM_IN(.(N, XS), .(s(M), YS), ZS)
U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U41(N, M, XS, X, weight_in(YS, X))
U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN(YS, X)

The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)
WEIGHT_IN(x1, x2)  =  WEIGHT_IN(x1)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U31(x1, x2, x3, x4, x5)  =  U31(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x6)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN(.(0, XS), YS, ZS) → SUM_IN(XS, YS, ZS)
SUM_IN(.(s(N), XS), .(M, YS), ZS) → SUM_IN(.(N, XS), .(s(M), YS), ZS)

The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN(.(0, XS), YS, ZS) → SUM_IN(XS, YS, ZS)
SUM_IN(.(s(N), XS), .(M, YS), ZS) → SUM_IN(.(N, XS), .(s(M), YS), ZS)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ UsableRulesReductionPairsProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUM_IN(.(s(N), XS), .(M, YS)) → SUM_IN(.(N, XS), .(s(M), YS))
SUM_IN(.(0, XS), YS) → SUM_IN(XS, YS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

SUM_IN(.(0, XS), YS) → SUM_IN(XS, YS)
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + 2·x2   
POL(0) = 0   
POL(SUM_IN(x1, x2)) = 2·x1 + 2·x2   
POL(s(x1)) = x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
QDP
                            ↳ RuleRemovalProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUM_IN(.(s(N), XS), .(M, YS)) → SUM_IN(.(N, XS), .(s(M), YS))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

SUM_IN(.(s(N), XS), .(M, YS)) → SUM_IN(.(N, XS), .(s(M), YS))


Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(SUM_IN(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 2 + x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
                          ↳ QDP
                            ↳ RuleRemovalProof
QDP
                                ↳ PisEmptyProof
              ↳ PiDP

Q DP problem:
P is empty.
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN(YS, X)
WEIGHT_IN(.(N, .(M, XS)), X) → U31(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))

The TRS R consists of the following rules:

weight_in(.(X, []), X) → weight_out(.(X, []), X)
weight_in(.(N, .(M, XS)), X) → U3(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))
sum_in([], YS, YS) → sum_out([], YS, YS)
sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U3(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → U4(N, M, XS, X, weight_in(YS, X))
U4(N, M, XS, X, weight_out(YS, X)) → weight_out(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in(x1, x2)  =  weight_in(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
weight_out(x1, x2)  =  weight_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x5)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
WEIGHT_IN(x1, x2)  =  WEIGHT_IN(x1)
U31(x1, x2, x3, x4, x5)  =  U31(x5)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U31(N, M, XS, X, sum_out(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN(YS, X)
WEIGHT_IN(.(N, .(M, XS)), X) → U31(N, M, XS, X, sum_in(.(N, .(M, XS)), .(0, XS), YS))

The TRS R consists of the following rules:

sum_in(.(0, XS), YS, ZS) → U2(XS, YS, ZS, sum_in(XS, YS, ZS))
sum_in(.(s(N), XS), .(M, YS), ZS) → U1(N, XS, M, YS, ZS, sum_in(.(N, XS), .(s(M), YS), ZS))
U2(XS, YS, ZS, sum_out(XS, YS, ZS)) → sum_out(.(0, XS), YS, ZS)
U1(N, XS, M, YS, ZS, sum_out(.(N, XS), .(s(M), YS), ZS)) → sum_out(.(s(N), XS), .(M, YS), ZS)
sum_in([], YS, YS) → sum_out([], YS, YS)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
[]  =  []
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
0  =  0
sum_out(x1, x2, x3)  =  sum_out(x3)
U2(x1, x2, x3, x4)  =  U2(x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x6)
WEIGHT_IN(x1, x2)  =  WEIGHT_IN(x1)
U31(x1, x2, x3, x4, x5)  =  U31(x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ UsableRulesReductionPairsProof

Q DP problem:
The TRS P consists of the following rules:

U31(sum_out(YS)) → WEIGHT_IN(YS)
WEIGHT_IN(.(N, .(M, XS))) → U31(sum_in(.(N, .(M, XS)), .(0, XS)))

The TRS R consists of the following rules:

sum_in(.(0, XS), YS) → U2(sum_in(XS, YS))
sum_in(.(s(N), XS), .(M, YS)) → U1(sum_in(.(N, XS), .(s(M), YS)))
U2(sum_out(ZS)) → sum_out(ZS)
U1(sum_out(ZS)) → sum_out(ZS)
sum_in([], YS) → sum_out(YS)

The set Q consists of the following terms:

sum_in(x0, x1)
U2(x0)
U1(x0)

We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

U31(sum_out(YS)) → WEIGHT_IN(YS)
WEIGHT_IN(.(N, .(M, XS))) → U31(sum_in(.(N, .(M, XS)), .(0, XS)))
The following rules are removed from R:

sum_in([], YS) → sum_out(YS)
Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = x1 + 2·x2   
POL(0) = 0   
POL(U1(x1)) = x1   
POL(U2(x1)) = x1   
POL(U31(x1)) = x1   
POL(WEIGHT_IN(x1)) = 1 + 2·x1   
POL([]) = 2   
POL(s(x1)) = x1   
POL(sum_in(x1, x2)) = x1 + 2·x2   
POL(sum_out(x1)) = 2 + 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
QDP
                            ↳ PisEmptyProof

Q DP problem:
P is empty.
The TRS R consists of the following rules:

sum_in(.(0, XS), YS) → U2(sum_in(XS, YS))
sum_in(.(s(N), XS), .(M, YS)) → U1(sum_in(.(N, XS), .(s(M), YS)))
U1(sum_out(ZS)) → sum_out(ZS)
U2(sum_out(ZS)) → sum_out(ZS)

The set Q consists of the following terms:

sum_in(x0, x1)
U2(x0)
U1(x0)

We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.